package fun.yao.common.queue;

/**
 * 存储对象为 字节数组 的自定义队列
 * @author csl
 *
 */
public class FileCahceQueueBytes extends AFileCacheQueue
{
    public FileCahceQueueBytes()
    {
        super();
    }

    public FileCahceQueueBytes(int iMaxSize)
    {
        super(iMaxSize);
    }

    public void add(byte[] msg) throws Exception
    {
        super.addObject(msg);
    }

    public byte[] pool() throws Exception
    {
        return (byte[])super.pollObject(true);
    }

    public byte[] peek() throws Exception
    {
        return  (byte[])super.pollObject(false);
    }

    @Override
    protected byte[] transforToBytes(Object obj) throws Exception
    {
        return (byte[])obj;
    }

    @Override
    protected Object transforToObject(byte[] msg) throws Exception
    {
        return msg;
    }

}
